<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>chess</title>
        <style>
            #chess
            {
                margin-left: auto;
                margin-right: auto;
                border: 2px solid black;
                border-collapse: collapse;
            }
            #chess td
            {
                border: 1px solid black;
                width: 50px;
                height: 50px;
            }
            <?php
                $color1 = "#000000";
                $color2 = "#FFFFFF";?>
        </style>
    </head>
    <body>
        <table id="chess">
        <?php
       
        for ($i = 0; $i <= 7; $i++) 
        {?>
            <tr>
            <?php for($j = 0; $j <= 7; $j++)
            {
                   if(($i+$j)%2==0)
                        {
                        $color = $color1;
                        ?>
                        <td style="background: <?php echo $color;?>">  </td>
                        <?php }
                    else {
                         $color = $color2;
                        ?>
                        <td style="background: <?php echo $color;?>">  </td>
                    <?php } ?>
            <?php } ?>
            </tr>
        <?php } ?>
        </table>
    </body>
</html>